<%@ page language="java" pageEncoding="UTF-8"%><%request.setAttribute("ctx", request.getContextPath()); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/pub/frontHead.jsp" %>
</head>
<body>    
<%@ include file="slice/topMenu.jsp"%>
    <div class="center">
    	<div class="login" id="loginJs">
        	<div class="login_lf">
            	<h1>登录贝婴轩</h1>
                <form id="loginForm">
                <ul class="login_meg">
                	<li>
                    	<input type="text" class="login_user" id="uid" name="uid"  value="电子邮箱" keyword="电子邮箱" />
                    </li>
                    <li>
                    	<input type="password" class="login_psd" id="pwd" name="pwd" />
                    </li>
                    <li>
                    	<input type="text" class="login_code" id="checkCode" name="checkCode" value="验证码" keyword="验证码" />
                        <span class="login_ah_cd">
                        	<img id="checkImg" width="93" height="37"/>
                        </span>
                        <a href="javascript:changePic();" title="换一张" class="float_lf top10">换一张</a>
                    </li>
                    <li>
                    	<input type="checkbox" class="float_lf login_checkbox" name="remember" value="1" checked="checked"/><span  class="float_lf top5">记住我（下次自动登录）</span>
                    </li>
                    <li>
                    	<a href="javascript:doLogin();" class="button float_lf">登&nbsp;&nbsp;录</a>
                        <a href="javascript:goFindPwd();" title="忘记密码了" class="float_lf top10">忘记密码了？</a>
                    </li>
                </ul>
                </form>
            </div>
            <div class="login_rg">
            	<p>还没有婴贝轩账号？<a href="javascript:viewRegist();" title="立即注册">立即注册</a></p>
<!--                 <p>你还可以用以下方式直接登录：</p> -->
<!--                 <div class="login_links"> -->
<!--                 	<a class="login_sinaweibo" href="#" title="新浪微博">新浪微博</a> -->
<!--                     <a class="login_qq2" href="javascript:alert('开发中...');" title="QQ">qq</a> -->
<!--                     <a class="login_taobao" href="javascript:alert('开发中...');" title="淘宝">淘宝</a> -->
<!--                     <a class="login_renren" href="javascript:alert('开发中...');" title="人人">人人</a> -->
<!--                     <a class="login_wangyi" href="javascript:alert('开发中...');" title="网易" >网易</a> -->
<!--                     <a class="login_txweibo" href="javascript:alert('开发中...');" title="腾讯微博">腾讯微博</a> -->
<!--                     <a class="login_douban" href="javascript:alert('开发中...');" title="豆瓣">豆瓣</a> -->
<!--                     <a class="login_baidu" href="javascript:alert('开发中...');" title="百度">百度</a> -->
<!--                 </div> -->
            </div>
        </div>
    </div>
<%@ include file="slice/footer.jsp"%>
<script type="text/javascript" src="${ctx}/front/js/ybxJs.js"></script>
<script type="text/javascript">
<!--
//初始化后自动执行
$(document).ready(function(e) {
	changePic();
});

//更换验证码
function changePic(){	
	$("#checkImg").attr("src","${ctx}/frontSys!getCheckPic.action?time="+(new Date()).getTime());
}
//进入注册页面
function viewRegist(){
	location.href="${ctx}/frontSys!viewRegist.action";
}
//忘记密码
function goFindPwd(){
	location.href="${ctx}/frontSys!goFindPwd.action";
}

//登陆
function doLogin(){
	if ($("#uid").val()== ""||$("#uid").val()=='电子邮箱'){
		alert('电子邮箱不能为空！');
		return;
	}
	if ($("#pwd").val() == ""){
		alert('密码不能为空！');
		return;
	}
	if ($("#pwd").val().length<6){
		alert('密码长度至少6位！');
		return;
	}
	if ($("#checkCode").val()== ""||$("#checkCode").val()=='验证码'){
		alert('验证码不能为空！');
		return;
	}
	var url="${ctx}/frontSys!login.action";
	$.post(url, $("#loginForm").serialize() ,function callback(txt){   
			var json = $.parseJSON(txt);   
			if (json.code==0) {					
				location.href="${ctx}/front!viewIndex.action";					
			}else{
				alert('登录失败！请检查帐号/密码/验证码！');
			}
	}); 
}
//-->
</script>
</body>
</html>